package generator.statements;

/**
 * Transport SQL record mapper.
 * 
 * @author Necro
 * @author Marek Snopkowski <snpy@snpy.info>
 * @version 11.04.2008
 */
public class Transport extends Statement
{    
    private static String[] types = { "Podróż Autokarem", "Wynajęty Samochód", "Lot Samolotem", "Podróż Jachtem" };
    
    private int transportID;
    private String name;
    
    private Transport(String name, int ID)
    {
        this.transportID = ID;
        this.name        = name;
    }
    
    public static Transport get(int idx)
    {
        return new Transport(types[idx], idx + 1);
    }
    
    public static int getTypeCount()
    {
        return types.length;
    }

    @Override
    public int getId() {
        return transportID;
    }

    public String getName() {
        return name;
    }
    
    public Object[] getFieldsValueCollection()
    {
        return new Object[]{ transportID, name };
    }
    
    public String getFieldsNameSet()
    {
        return "[transport_id], [type_of]";
    }

    @Override
    public String getTableName()
    {
        return "transport";
    }
}
